﻿<%@ Page Culture="auto" UICulture="auto" Title="Horizontal table display" Language="C#"
    MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="HorizontalTableDisplay.aspx.cs"
    Inherits="BM.Tools.WebControls.MForm.Example.Display.Modifiers.HorizontalTableDisplay" %>

<%@ Register Assembly="BM.Tools.WebControls.MForm" Namespace="BM.Tools.WebControls.MForm.Controls"
    TagPrefix="mf" %>
<%@ Register Assembly="BM.Tools.WebControls.MForm" Namespace="BM.Tools.WebControls.MForm.Controls.Additions"
    TagPrefix="mfadd" %>
<%@ Register Assembly="BM.Tools.WebControls.MForm" Namespace="BM.Tools.WebControls.MForm.Controls.Modifiers"
    TagPrefix="mfmod" %>
<%@ Register TagPrefix="mftitle" Namespace="BM.Tools.WebControls.MForm.Controls.Titles"
    Assembly="BM.Tools.WebControls.MForm" %>
<%@ Register TagPrefix="contents" TagName="ArtGallery" Src="~/Display/UserControls/ArtGalleryContent.ascx" %>
<%@ Register TagPrefix="contents" TagName="Museum" Src="~/Display/UserControls/MuseumContent.ascx" %>
<%@ Register TagPrefix="contents" TagName="Cinema" Src="~/Display/UserControls/CinemaContent.ascx" %>
<%@ Register TagPrefix="contents" TagName="Pub" Src="~/Display/UserControls/PubContent.ascx" %>
<%@ Register TagPrefix="contents" TagName="Restaurant" Src="~/Display/UserControls/RestaurantContent.ascx" %>
<asp:Content runat="server" ContentPlaceHolderID="Demonstration">
    <p>
        The items are displayed as a table with each item being a new row.
    </p>
    <mf:RootValidator runat="server" ControlToValidate="Root1" />
    <mf:Root ID="Root1" runat="server">
        <UriMappings>
            <mf:UriMapping Prefix="xs" Namespace="http://www.w3.org/2001/XMLSchema"></mf:UriMapping>
            <mf:UriMapping Prefix="" Namespace=""></mf:UriMapping>
        </UriMappings>
        <Contents>
            <mf:Branch Name="CityActivities" runat="server">
                <Contents>
                    <mf:Branch Name="ArtGallery" runat="server" MaxOccurs="100" MinOccurs="0">
                        <Contents>
                            <contents:ArtGallery SubTitlesHidden="true" ID="ArtGallery1" runat="server" />
                        </Contents>
                        <Modifiers>
                            <mfmod:HorizontalTableDisplayModifier />                                
                        </Modifiers>
                    </mf:Branch>
                    <mf:Branch Name="Museum" runat="server" MaxOccurs="100" MinOccurs="0">
                        <Contents>
                            <contents:Museum SubTitlesHidden="true" ID="Museum1" runat="server" />
                        </Contents>
                        <Modifiers>
                            <mfmod:HorizontalTableDisplayModifier />                                
                        </Modifiers>
                    </mf:Branch>
                    <mf:Branch Name="Cinema" runat="server" MaxOccurs="100" MinOccurs="0">
                        <Contents>
                            <contents:Cinema SubTitlesHidden="true" ID="Cinema1" runat="server" />
                        </Contents>
                        <Modifiers>
                            <mfmod:HorizontalTableDisplayModifier />
                        </Modifiers>
                    </mf:Branch>
                    <mf:Branch Name="Pub" runat="server" MaxOccurs="100" MinOccurs="0">
                        <Contents>
                            <contents:Pub SubTitlesHidden="true" ID="Pub1" runat="server" />
                        </Contents>
                        <Modifiers>
                            <mfmod:HorizontalTableDisplayModifier >
                                
                            </mfmod:HorizontalTableDisplayModifier>
                        </Modifiers>
                    </mf:Branch>
                    <mf:Branch Name="Restaurant" runat="server" MaxOccurs="100" MinOccurs="0">
                        <Contents>
                            <contents:Restaurant SubTitlesHidden="true" ID="Restaurant1" runat="server" />
                        </Contents>
                        <Modifiers>
                            <mfmod:HorizontalTableDisplayModifier />
                        </Modifiers>
                    </mf:Branch>
                </Contents>
            </mf:Branch>
        </Contents>
    </mf:Root>
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="Description" runat="server">
    <p>
        The horizontal table display can be added using the <code>HorizontalTableDisplayModifier</code>
        modifier.
    </p>
    <p>
        With this display, each MForm item control is displayed as a row of a table.
    </p>
    <p>
        The usage of the horizontal table display is restricted to only the simplest MForm
        controls that have no more than 4-6 leaf children. It is also strongly advised not
        to insert any other content in MForm control that uses this display.
    </p>
    <p>
        With this display, each MForm item control is displayed as a row.
    </p>
    <p>
        To further customize the table, the <code>CellStyle</code> and <code>RowStyle</code> properties can be used.
    </p>
    <p>
        To change the settings of the table title, the <code>Title</code> can be used.
    </p>
    <p>
        Currently it is not possible to display items of different types in the same table,
        however this functionality is planned.
    </p>
    <div class="Remark">
        <p>
            For best results, the control with vertical table display specified should not have
            the content to complicated. The layout may get broken if this item has children
            that can be added.</p>
    </div>
</asp:Content>
